
#ifndef __TRIANGLE_H__
#define __TRIANGLE_H__

#include "Real3.h"
#include "Real2.h"
#include <vector>

using namespace std;

class Vertex;

class Triangle
{
public:

	// Constructor
	Triangle() {}
	Triangle(uint _a, uint _b, uint _c)
	{
		a = _a;
		b = _b;
		c = _c;
	}

	// Indices
#ifdef BUFFER_BIT_16
	ushort a;
	ushort b;
	ushort c;
#else
	uint a;
	uint b;
	uint c;
#endif

	// Calculated Midpoints
	Real3 MidPoint(std::vector<Vertex> *vertices) const;
	Real3 Side0MidPoint(std::vector<Vertex> *vertices) const;
	Real3 Side1MidPoint(std::vector<Vertex> *vertices) const;
	Real3 Side2MidPoint(std::vector<Vertex> *vertices) const;

	// Calculated Normals
	Real3 Normal(std::vector<Vertex> *vertices) const;
	Real3 Side0Normal(std::vector<Vertex> *vertices) const;
	Real3 Side1Normal(std::vector<Vertex> *vertices) const;
	Real3 Side2Normal(std::vector<Vertex> *vertices) const;

	// Calculated Texture Coordinates
	Real2 Tex(std::vector<Vertex> *vertices) const;
	Real2 Side0Tex(std::vector<Vertex> *vertices) const;
	Real2 Side1Tex(std::vector<Vertex> *vertices) const;
	Real2 Side2Tex(std::vector<Vertex> *vertices) const;
};

#endif // __TRIANGLE_H__